using Google.ProtocolBuffers;
using Google.ProtocolBuffers.Collections;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class GetPackageListRequest : GeneratedMessageLite<GetPackageListRequest, GetPackageListRequest.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<GetPackageListRequest, GetPackageListRequest.Builder>
		{
			private bool resultIsReadOnly;
			private GetPackageListRequest result;
			protected override GetPackageListRequest.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override GetPackageListRequest MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override GetPackageListRequest DefaultInstanceForType
			{
				get
				{
					return GetPackageListRequest.DefaultInstance;
				}
			}
			public BaseRequest BaseRequest
			{
				get
				{
					return this.result.BaseRequest;
				}
				set
				{
					this.SetBaseRequest(value);
				}
			}
			public uint Count
			{
				get
				{
					return this.result.Count;
				}
				set
				{
					this.SetCount(value);
				}
			}
			public IPopsicleList<Package> ListList
			{
				get
				{
					return this.PrepareBuilder().list_;
				}
			}
			public int ListCount
			{
				get
				{
					return this.result.ListCount;
				}
			}
			public uint Type
			{
				get
				{
					return this.result.Type;
				}
				set
				{
					this.SetType(value);
				}
			}
			public Builder()
			{
				this.result = GetPackageListRequest.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(GetPackageListRequest cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private GetPackageListRequest PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					GetPackageListRequest other = this.result;
					this.result = new GetPackageListRequest();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override GetPackageListRequest.Builder Clear()
			{
				this.result = GetPackageListRequest.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override GetPackageListRequest.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new GetPackageListRequest.Builder(this.result);
				}
				return new GetPackageListRequest.Builder().MergeFrom(this.result);
			}
			public override GetPackageListRequest BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override GetPackageListRequest.Builder MergeFrom(IMessageLite other)
			{
				if (other is GetPackageListRequest)
				{
					return this.MergeFrom((GetPackageListRequest)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override GetPackageListRequest.Builder MergeFrom(GetPackageListRequest other)
			{
				return this;
			}
			public override GetPackageListRequest.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override GetPackageListRequest.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(GetPackageListRequest._getPackageListRequestFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = GetPackageListRequest._getPackageListRequestFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 10u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 10u)
						{
							BaseRequest.Builder builder = BaseRequest.CreateBuilder();
							if (this.result.hasBaseRequest)
							{
								builder.MergeFrom(this.BaseRequest);
							}
							input.ReadMessage(builder, extensionRegistry);
							this.BaseRequest = builder.BuildPartial();
							continue;
						}
					}
					else
					{
						if (num3 == 16u)
						{
							this.result.hasCount = input.ReadUInt32(ref this.result.count_);
							continue;
						}
						if (num3 == 26u)
						{
							input.ReadMessageArray<Package>(num, text, this.result.list_, Package.DefaultInstance, extensionRegistry);
							continue;
						}
						if (num3 == 32u)
						{
							this.result.hasType = input.ReadUInt32(ref this.result.type_);
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public GetPackageListRequest.Builder SetBaseRequest(BaseRequest value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasBaseRequest = true;
				this.result.baseRequest_ = value;
				return this;
			}
			public GetPackageListRequest.Builder SetBaseRequest(BaseRequest.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.hasBaseRequest = true;
				this.result.baseRequest_ = builderForValue.Build();
				return this;
			}
			public GetPackageListRequest.Builder MergeBaseRequest(BaseRequest value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				if (this.result.hasBaseRequest && this.result.baseRequest_ != BaseRequest.DefaultInstance)
				{
					this.result.baseRequest_ = BaseRequest.CreateBuilder(this.result.baseRequest_).MergeFrom(value).BuildPartial();
				}
				else
				{
					this.result.baseRequest_ = value;
				}
				this.result.hasBaseRequest = true;
				return this;
			}
			public GetPackageListRequest.Builder ClearBaseRequest()
			{
				this.PrepareBuilder();
				this.result.hasBaseRequest = false;
				this.result.baseRequest_ = null;
				return this;
			}
			public GetPackageListRequest.Builder SetCount(uint value)
			{
				this.PrepareBuilder();
				this.result.hasCount = true;
				this.result.count_ = value;
				return this;
			}
			public GetPackageListRequest.Builder ClearCount()
			{
				this.PrepareBuilder();
				this.result.hasCount = false;
				this.result.count_ = 0u;
				return this;
			}
			public Package GetList(int index)
			{
				return this.result.GetList(index);
			}
			public GetPackageListRequest.Builder SetList(int index, Package value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.list_[index] = value;
				return this;
			}
			public GetPackageListRequest.Builder SetList(int index, Package.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.list_[index] = builderForValue.Build();
				return this;
			}
			public GetPackageListRequest.Builder AddList(Package value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.list_.Add(value);
				return this;
			}
			public GetPackageListRequest.Builder AddList(Package.Builder builderForValue)
			{
				ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
				this.PrepareBuilder();
				this.result.list_.Add(builderForValue.Build());
				return this;
			}
			public GetPackageListRequest.Builder AddRangeList(IEnumerable<Package> values)
			{
				this.PrepareBuilder();
				this.result.list_.Add(values);
				return this;
			}
			public GetPackageListRequest.Builder ClearList()
			{
				this.PrepareBuilder();
				this.result.list_.Clear();
				return this;
			}
			public GetPackageListRequest.Builder SetType(uint value)
			{
				this.PrepareBuilder();
				this.result.hasType = true;
				this.result.type_ = value;
				return this;
			}
			public GetPackageListRequest.Builder ClearType()
			{
				this.PrepareBuilder();
				this.result.hasType = false;
				this.result.type_ = 0u;
				return this;
			}
		}
		public const int BaseRequestFieldNumber = 1;
		public const int CountFieldNumber = 2;
		public const int ListFieldNumber = 3;
		public const int TypeFieldNumber = 4;
		private static readonly GetPackageListRequest defaultInstance;
		private static readonly string[] _getPackageListRequestFieldNames;
		private static readonly uint[] _getPackageListRequestFieldTags;
		private bool hasBaseRequest;
		private BaseRequest baseRequest_;
		private bool hasCount;
		private uint count_;
		private PopsicleList<Package> list_ = new PopsicleList<Package>();
		private bool hasType;
		private uint type_;
		private int memoizedSerializedSize = -1;
		public static GetPackageListRequest DefaultInstance
		{
			get
			{
				return GetPackageListRequest.defaultInstance;
			}
		}
		public override GetPackageListRequest DefaultInstanceForType
		{
			get
			{
				return GetPackageListRequest.DefaultInstance;
			}
		}
		protected override GetPackageListRequest ThisMessage
		{
			get
			{
				return this;
			}
		}
		public BaseRequest BaseRequest
		{
			get
			{
				return this.baseRequest_ ?? BaseRequest.DefaultInstance;
			}
		}
		public uint Count
		{
			get
			{
				return this.count_;
			}
		}
		public IList<Package> ListList
		{
			get
			{
				return this.list_;
			}
		}
		public int ListCount
		{
			get
			{
				return this.list_.Count;
			}
		}
		public uint Type
		{
			get
			{
				return this.type_;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				if (!this.hasBaseRequest)
				{
					return false;
				}
				if (!this.hasCount)
				{
					return false;
				}
				if (!this.BaseRequest.IsInitialized)
				{
					return false;
				}
				bool result;
				using (IEnumerator<Package> enumerator = this.ListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						Package current = enumerator.get_Current();
						if (!current.IsInitialized)
						{
							result = false;
							return result;
						}
					}
					return true;
				}
				return result;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasBaseRequest)
				{
					num += CodedOutputStream.ComputeMessageSize(1, this.BaseRequest);
				}
				if (this.hasCount)
				{
					num += CodedOutputStream.ComputeUInt32Size(2, this.Count);
				}
				using (IEnumerator<Package> enumerator = this.ListList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						Package current = enumerator.get_Current();
						num += CodedOutputStream.ComputeMessageSize(3, current);
					}
				}
				if (this.hasType)
				{
					num += CodedOutputStream.ComputeUInt32Size(4, this.Type);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private GetPackageListRequest()
		{
		}
		public Package GetList(int index)
		{
			return this.list_[index];
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] getPackageListRequestFieldNames = GetPackageListRequest._getPackageListRequestFieldNames;
			if (this.hasBaseRequest)
			{
				output.WriteMessage(1, getPackageListRequestFieldNames[0], this.BaseRequest);
			}
			if (this.hasCount)
			{
				output.WriteUInt32(2, getPackageListRequestFieldNames[1], this.Count);
			}
			if (this.list_.Count > 0)
			{
				output.WriteMessageArray<Package>(3, getPackageListRequestFieldNames[2], this.list_);
			}
			if (this.hasType)
			{
				output.WriteUInt32(4, getPackageListRequestFieldNames[3], this.Type);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasBaseRequest)
			{
				num ^= this.baseRequest_.GetHashCode();
			}
			if (this.hasCount)
			{
				num ^= this.count_.GetHashCode();
			}
			using (IEnumerator<Package> enumerator = this.list_.GetEnumerator())
			{
				while (enumerator.MoveNext())
				{
					Package current = enumerator.get_Current();
					num ^= current.GetHashCode();
				}
			}
			if (this.hasType)
			{
				num ^= this.type_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object object_0)
		{
			GetPackageListRequest getPackageListRequest = object_0 as GetPackageListRequest;
			if (getPackageListRequest == null)
			{
				return false;
			}
			if (this.hasBaseRequest != getPackageListRequest.hasBaseRequest || (this.hasBaseRequest && !this.baseRequest_.Equals(getPackageListRequest.baseRequest_)))
			{
				return false;
			}
			if (this.hasCount != getPackageListRequest.hasCount || (this.hasCount && !this.count_.Equals(getPackageListRequest.count_)))
			{
				return false;
			}
			if (this.list_.Count != getPackageListRequest.list_.Count)
			{
				return false;
			}
			for (int i = 0; i < this.list_.Count; i++)
			{
				if (!this.list_[i].Equals(getPackageListRequest.list_[i]))
				{
					return false;
				}
			}
			return this.hasType == getPackageListRequest.hasType && (!this.hasType || this.type_.Equals(getPackageListRequest.type_));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<GetPackageListRequest, GetPackageListRequest.Builder>.PrintField("BaseRequest", this.hasBaseRequest, this.baseRequest_, writer);
			GeneratedMessageLite<GetPackageListRequest, GetPackageListRequest.Builder>.PrintField("Count", this.hasCount, this.count_, writer);
			GeneratedMessageLite<GetPackageListRequest, GetPackageListRequest.Builder>.PrintField<Package>("List", this.list_, writer);
			GeneratedMessageLite<GetPackageListRequest, GetPackageListRequest.Builder>.PrintField("Type", this.hasType, this.type_, writer);
		}
		public static GetPackageListRequest ParseFrom(byte[] data)
		{
			return GetPackageListRequest.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private GetPackageListRequest MakeReadOnly()
		{
			this.list_.MakeReadOnly();
			return this;
		}
		public static GetPackageListRequest.Builder CreateBuilder()
		{
			return new GetPackageListRequest.Builder();
		}
		public override GetPackageListRequest.Builder ToBuilder()
		{
			return GetPackageListRequest.CreateBuilder(this);
		}
		public override GetPackageListRequest.Builder CreateBuilderForType()
		{
			return new GetPackageListRequest.Builder();
		}
		public static GetPackageListRequest.Builder CreateBuilder(GetPackageListRequest prototype)
		{
			return new GetPackageListRequest.Builder(prototype);
		}
		static GetPackageListRequest()
		{
			GetPackageListRequest.defaultInstance = new GetPackageListRequest().MakeReadOnly();
			GetPackageListRequest._getPackageListRequestFieldNames = new string[]
			{
				"BaseRequest",
				"Count",
				"List",
				"Type"
			};
			GetPackageListRequest._getPackageListRequestFieldTags = new uint[]
			{
				10u,
				16u,
				26u,
				32u
			};
			object.ReferenceEquals(micromsg.Proto.GetPackageListRequest.Descriptor, null);
		}
	}
}
